﻿using SmartPlant.Model;
using SmartPlant.Model.Biz;
using SmartPlant.Services.Interfaces;
using SmartPlant.WinCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net.Http;
using System.Security.Cryptography;
using System.IO;
using System.Threading.Tasks;
using System.Web;
using static System.Formats.Asn1.AsnWriter;

namespace SmartPlant.Services
{
    public class PDGeneralService : BaseService, IPDGeneralService
    {

        public async Task<bool> UpdateProcessDataAsync(decimal proId, PdGeneral pd)
        {
            string uri = $"/api/Project/{proId}/pd-general-api";
            var r = await PutBodyAsync<bool, PdGeneral>(uri, pd);
            return r.data;
        }

        public async Task<PdGeneral> GetProcessDataAsync(decimal proId, ObjectDefId objectDefId, decimal cmpntIdOrLineId, decimal caseId = 0)
        {
            string uri = $"/api/Project/{proId}/pd-general-api/case/{objectDefId}/{cmpntIdOrLineId}/{caseId}";
            var r = await GetAsync<PdGeneral>(uri);
            return r.data;
        }

      
    }
}